package com.corona.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.corona.Game;
import com.corona.game.util.TextureCache;

/* compiled from: Battle.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/FadeAnim.class */
class FadeAnim extends Action {
    int slow;
    public Action.Layer layer = Action.Layer.gui_114;
    int timer = 0;
    Sprite sprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/intro_frame6.png")));

    public FadeAnim(Game game, int slow, Action nextAction) {
        super(new Object[0]);
        this.slow = 1;
        this.nextAction = nextAction;
        this.slow = slow;
        this.sprite.setPosition(0.0f, 0.0f);
    }

    @Override // com.corona.game.Action
    public String getCamera() {
        return "gui";
    }

    @Override // com.corona.game.Action
    public Action.Layer getLayer() {
        return this.layer;
    }

    @Override // com.corona.game.Action
    public void firstStep(Game game) {
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.timer >= 2 * this.slow) {
            if (this.timer < 4 * this.slow) {
                this.sprite.draw(game.uiBatch, 0.25f);
            } else if (this.timer < 6 * this.slow) {
                this.sprite.draw(game.uiBatch, 0.5f);
            } else if (this.timer < 12 * this.slow) {
                this.sprite.draw(game.uiBatch, 1.0f);
            } else if (this.timer < 14 * this.slow) {
                this.sprite.draw(game.uiBatch, 0.75f);
            } else if (this.timer < 16 * this.slow) {
                this.sprite.draw(game.uiBatch, 0.5f);
            } else if (this.timer < 18 * this.slow) {
                this.sprite.draw(game.uiBatch, 0.25f);
            } else {
                game.actionStack.remove(this);
                game.insertAction(this.nextAction);
            }
        }
        this.timer++;
    }
}
